<ion-view title="运单列表">
  <ion-nav-buttons side="left">
    <button class="button back-button buttons icon ion-ios-arrow-left button-clear header-item" nav-direction="back" ng-click="myGoBack()">返回</button>
  </ion-nav-buttons>
  <ion-nav-buttons side="right">
    <button class="button button-icon icon ion-ios-search" ui-sref="cydSearch"></button>
  </ion-nav-buttons>

  <ion-content on-drag-right="dragRight()">

    <ion-refresher
            pulling-text="下拉刷新..."
            on-refresh="doRefresh()">
    </ion-refresher>

    <div ng-if="showloading" style="margin-top:60px; text-align: center">
      <ion-spinner icon="ios" style="height: 60px; width: 60px;"></ion-spinner>
    </div>
    <ion-list ng-if="showloading == false">
      <h5 ng-if="cydData==''" style="color: #69717d;text-align: center;margin-top: 50px;">未找到数据</h5>
      <ion-item collection-repeat="cyd in cydData" class="cydListItem" style="padding-top: 5px; padding-bottom: 5px;border-top-style: none;border-bottom-style: none;">
        <div class="ydList card list-inset" style="margin-bottom: 5px;">
          <div class="xuhao">
            <div class="light list-operation button-border" ng-if="cyd.cyzt==10&&bmmc==cyd.lrbmmc" ui-sref="cydChange({ cyd_id : cyd.cyd_id })">
              <i class="light list-operation">修改</i>
            </div>
            <i class="light" style="float: right;" ng-if="cyd.cyzt==10&&bmmc==cyd.lrbmmc">丨</i>
            <div class="light list-operation button-border" ng-if="cyd.cyzt==10&&bmmc==cyd.lrbmmc"  ng-click="yundandy(cyd.cyd_id)" >
              <i class="light list-operation">打印</i>
            </div>
          </div>
          <div ui-sref="cydtab({ cyd_id : cyd.cyd_id })">
            <label class="item item-input">
              <i class="list-input">承运单号：</i>
              <p>{{cyd.cydh}}</p>
              <img src="img/cyzt{{cyd.qsfs==2?'160':cyd.cyzt}}.png"class="zt">
            </label>
            <label class="item item-input">
              <p ng-if="cyd.shbmmc!=''&&cyd.mdd==''">{{cyd.lrbmmc}}<i class="ion-minus" style="font-size: 16px"></i><i class="ion-arrow-right-c" style="font-size: 16px"></i> {{cyd.shbmmc}}</p>
              <p ng-if="cyd.shbmmc==''&&cyd.mdd!=''">{{cyd.lrbmmc}}<i class="ion-minus" style="font-size: 16px"></i><i class="ion-arrow-right-c" style="font-size: 16px"></i> <span style="color: #62C847;">{{cyd.mdd}}</span></p>
              <p ng-if="cyd.shbmmc!=''&&cyd.mdd!=''">{{cyd.lrbmmc}}<i class="ion-minus" style="font-size: 16px"></i><i class="ion-arrow-right-c" style="font-size: 16px"></i> {{cyd.shbmmc}}<i class="ion-minus" style="font-size: 16px"></i><i class="ion-arrow-right-c" style="font-size: 16px"></i><span style="color: #62C847;">{{cyd.mdd}}</span></p>
            </label>
            <label class="item item-input">
              <i class="list-input">货名：</i>
              <p>{{cyd.hwmc}}</p>
            </label>
            <label class="item item-input">
              <i class="list-input">件数：</i>
              <p ng-if="cyd.hwsl!=''">{{cyd.hwsl}}件</p>
            </label>
            <label class="item item-input">
              <i class="list-input">运费：</i>
              <p ng-if="cyd.yf!=''">{{cyd.yf | number:2}}</p>
              <p ng-if="cyd.yf==''">0</p>
            </label>
            <label class="item item-input">
              <i class="list-input">货款：</i>
              <p>{{cyd.hdfk}}</p>
            </label>
          </div>
        </div>
      </ion-item>
    </ion-list>

    <ion-infinite-scroll   on-infinite="loadMore()"  distance="1%" ng-if="hasNextPage()"></ion-infinite-scroll>

  </ion-content>
  <ion-footer-bar style="height: 44px;padding: 10px;">
      <i style="font-size: 12px;">总单数：</i>
      <p style="font-size: 10px;">{{cydhj.ydhj}}</p>
      <i style="margin-left: 2px;font-size: 12px;">运费合计：</i>
      <p style="font-size: 10px;">{{cydhj.yfhj | number:2}}</p>
      <i style="margin-left: 2px;font-size: 12px;">货款合计：</i>
      <p style="font-size: 10px;">{{cydhj.hkhj | number:2}}</p>
  </ion-footer-bar>
</ion-view>
